<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/views/common/includetag.jsp"%>
<c:set var="yes_img" value="${ctx}/static/images/common/accept.png"/>
<c:set var="no_img" value="${ctx}/static/images/common/cancel.png"/>
<!DOCTYPE html>
<html lang="en_US">
    <head>
        <title><spring:message code="app.batch.title" /></title>
        <link rel="stylesheet" type="text/css" href="${ctx}/assets/jqueryplugin/jquery-validation/css/jquery.validate.css" />
        <link rel="stylesheet" type="text/css" href="${ctx}/assets/bootstrap/bootstrap-datepicker/css/datepicker.css" />
        <script type="text/javascript" src="${ctx}/assets/bootstrap/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
		<script type="text/javascript" src="${ctx}/assets/bootstrap/bootstrap-datepicker/js/locales/bootstrap-datepicker.zh-CN.js"></script>
        <script type="text/javascript" src="${ctx}/static/js/manage/courseTemplate/list.js"></script>
        <style type="text/css">
        	.input-group-addon {
			    width: 84px;
			    line-height: 20px;
			    height: 34px;
			    font-size: 12px;
			}
			.input-group {
			    position: relative;
			    display: inline-flex !important;
			    border-collapse: separate;
			    width: 360px;
			    margin-bottom: 5px;
			    line-height: 30px;
			    height: 34px;
			}
			.searchBtn {
			    height: 32px;
			    margin-bottom: 6px;
			}
			.imgPos{
				margin-bottom: 2px;
			}
        </style>
        <script type="text/javascript">
        	var query_batch = '${query_batch}';
    		var query_grade = '${query_grade}';
    		var query_course = '${query_course}';
        </script>
    </head>
    <body>
        <div class="clearfix"></div>
		<div class="row back-top-title">
			<div class="col-md-12">
				<span><spring:message code="app.courseTemplate.title" /></span>
			</div>
		</div>
		
       	<div class="row">
			<div class="col-md-12">
				<div class="panel panel-white">
					<div class="panel-body">
						<form style="position:relative" id="splitPage" action="${ctx}/manage/courseTemplate" method="POST" role="form" class="form-horizontal">  
							<!-- search part -->
							<div id="toolbar" class="panel panel-default" style="margin:-5 0 -5 0;padding:0 0 0 0;">
								<div class="panel-body">
									<div class="form-inline" role="form">
										<div class="form-inline form-group">
											<div class="input-group" style="width: 230px;margin-bottom: 5px;">
												<span class="input-group-addon"><spring:message code="app.batch.title.mc" /></span>
												<select id="query_batch" name="query_batch" class="form-control" style="width:150px;margin-right: 10px;">
													<option value="">---请选择---</option>
													<c:forEach var="item" items="${batchs}">
														<option value="${item.batchId}" <c:if test="${query_batch==item.batchId}">selected="selected"</c:if>>${item.batchName}</option>
													</c:forEach>
												</select>
											</div>
											<div class="input-group" style="width: 230px;margin-bottom: 5px;">
												<span class="input-group-addon"><spring:message code="app.common.title.grade.mc" /></span>
												<select id="query_grade" name="query_grade" class="form-control" style="width:150px;margin-right: 10px;"></select>
											</div>
											<div class="input-group" style="width: 230px;margin-bottom: 5px;">
												<span class="input-group-addon"><spring:message code="app.common.title.course.mc" /></span>
												<select id="query_course" name="query_course" class="form-control" style="width:150px;margin-right: 10px;"></select>
											</div>
											<%-- <div class="input-group" style="width: 340px;margin-bottom: 5px;">	
												<span class="input-group-addon"><spring:message code="app.batch.title.ksrq" /></span>
												<div class="input-append date" id="query_ksrq" data-date="" data-date-format="yyyy-mm-dd" style="width: 120px;margin-bottom: -35px;">
													<input type="text" size="16" name="query_ksrq" class="form-control" style="width: 120px;"
														value="<c:if test="${not empty query_ksrq}"><fmt:formatDate value="${query_ksrq}" pattern="yyyy-MM-dd"/></c:if>">
												    <span class="add-on"><i class="icon-th"></i></span>
												</div>
												<span style="margin: 0 5px;">至</span>
												<div class="input-append date" id="query_jsrq" data-date="" data-date-format="yyyy-mm-dd" style="width: 120px;margin-bottom: -35px;">
													<input type="text" size="16" name="query_ksrq" class="form-control" style="width: 120px;"
														value="<c:if test="${not empty query_ksrq}"><fmt:formatDate value="${query_jsrq}" pattern="yyyy-MM-dd"/></c:if>">
												    <span class="add-on"><i class="icon-th"></i></span>
												</div>
											</div>	 --%>
											<button type="submit" class="fa fa-search btn btn-warning searchBtn">查询</button>
										</div>
									</div>
							  	</div>
							  	<!-- buttons part -->
							  	<!-- <div class="row">
									<div class="col-md-12 space20">
										<a href="#none" class="btn btn-primary btn-add">
											<i class="fa fa-plus"></i>
											<spring:message code="app.common.action.add" />
										</a>
									</div>
								</div> -->
							</div>
							<!-- table part -->
							<table id="dataTable" class="table table-striped table-bordered table-hover table-full-width">
	                            <thead>
	                                <tr>
	                                    <th><spring:message code="app.common.title.serial" /></th>
	                                    <th><spring:message code="app.courseTemplate.title.batchName" /></th>
	                                    <th><spring:message code="app.courseTemplate.title.gradeNo" /></th>
	                                    <th><spring:message code="app.courseTemplate.title.courseNo" /></th>
	                                    <th><spring:message code="app.courseTemplate.title.startDate" /></th>
	                                    <th><spring:message code="app.courseTemplate.title.endDate" /></th>
	                                    <th><spring:message code="app.courseTemplate.title.validateStatus" /></th>
	                                    <th><spring:message code="app.courseTemplate.title.fileUploadStatus" /></th>
	                                    <th><spring:message code="app.common.action.operate" /></th>
	                                </tr>
	                            </thead>
	                            <tbody>
	                                <c:forEach items="${pagination.datas}" var="entity" varStatus="s">
	                                    <tr data-id="${entity.id}">
	                                        <td><c:out value="${s.index + 1}" /></td>
	                                        <td><c:out value="${entity.batchName}" /></td>
	                                        <td><c:out value="${entity.gradeNo}" /></td>
	                                        <td><c:out value="${entity.courseNo}" /></td>
	                                        <td><fmt:formatDate value="${entity.startDate}" pattern="yyyy-MM-dd"/></td>
	                                        <td><fmt:formatDate value="${entity.endDate}" pattern="yyyy-MM-dd"/></td>
	                                        <td>
	                                        	<span>
	                                        		<spring:message code="app.courseTemplate.title.validateArea.tzd"/>
													<c:choose>
														<c:when test="${entity.tzdCount==1}">
															<img class="imgPos" title='<spring:message code="app.courseTemplate.title.validate.success"/>' src="${yes_img}">
														</c:when>
														<c:otherwise>
															<img class="imgPos" title='<spring:message code="app.courseTemplate.title.validate.fail"/>' src="${no_img}">
														</c:otherwise>
													</c:choose>
												</span>
												<span>
													<spring:message code="app.courseTemplate.title.validateArea.qkq"/>
													<c:choose>
														<c:when test="${entity.qkCount==1}">
															<img class="imgPos" title='<spring:message code="app.courseTemplate.title.validate.success"/>' src="${yes_img}">
														</c:when>
														<c:otherwise>
															<img class="imgPos" title='<spring:message code="app.courseTemplate.title.validate.fail"/>' src="${no_img}">
														</c:otherwise>
													</c:choose>
												</span>
												<span>
													<spring:message code="app.courseTemplate.title.validateArea.khq"/>
													<c:choose>
														<c:when test="${entity.khCount==1}">
															<img class="imgPos" title='<spring:message code="app.courseTemplate.title.validate.success"/>' src="${yes_img}">
														</c:when>
														<c:otherwise>
															<img class="imgPos" title='<spring:message code="app.courseTemplate.title.validate.fail"/>' src="${no_img}">
														</c:otherwise>
													</c:choose>
												</span>
												<span>
													<spring:message code="app.courseTemplate.title.validateArea.kgt"/>
													<c:choose>
														<c:when test="${entity.kgtCount>0}">
															<img class="imgPos" title='<spring:message code="app.courseTemplate.title.validate.success"/>' src="${yes_img}">
														</c:when>
														<c:otherwise>
															<img class="imgPos" title='<spring:message code="app.courseTemplate.title.validate.fail"/>' src="${no_img}">
														</c:otherwise>
													</c:choose>
												</span>
												<span>
													<spring:message code="app.courseTemplate.title.validateArea.zgt"/>
													<c:choose>
														<c:when test="${entity.zgtCount>0}">
															<img class="imgPos" title='<spring:message code="app.courseTemplate.title.validate.success"/>' src="${yes_img}">
														</c:when>
														<c:otherwise>
															<img class="imgPos" title='<spring:message code="app.courseTemplate.title.validate.fail"/>' src="${no_img}">
														</c:otherwise>
													</c:choose>
												</span>
												<br>
												<span>
													<spring:message code="app.courseTemplate.title.validateArea.khttq"/>（${entity.khttCount}）
													<c:choose>
														<c:when test="${entity.khttCount==3}">
															<img class="imgPos" title='<spring:message code="app.courseTemplate.title.validate.success"/>' src="${yes_img}">
														</c:when>
														<c:otherwise>
															<img class="imgPos" title='<spring:message code="app.courseTemplate.title.validate.fail"/>' src="${no_img}">
														</c:otherwise>
													</c:choose>
												</span>
												<span>
													<spring:message code="app.courseTemplate.title.validateArea.kgtttq"/>（${entity.kgtttCount}）
													<c:choose>
														<c:when test="${entity.kgtttCount==3}">
															<img class="imgPos" title='<spring:message code="app.courseTemplate.title.validate.success"/>' src="${yes_img}">
														</c:when>
														<c:otherwise>
															<img class="imgPos" title='<spring:message code="app.courseTemplate.title.validate.fail"/>' src="${no_img}">
														</c:otherwise>
													</c:choose>
												</span>
	                                        </td>
	                                        <td>
	                                        	<span>
	                                        		<spring:message code="app.courseTemplate.title.zm"/>
		                                        	<c:choose>
														<c:when test="${entity.zmCount>0}"><img class="imgPos" src="${yes_img}"></c:when>
														<c:otherwise><img class="imgPos" src="${no_img}"></c:otherwise>
													</c:choose>
												</span><br>
												<span>
	                                        		<spring:message code="app.courseTemplate.title.fm"/>
		                                        	<c:choose>
														<c:when test="${entity.fmCount>0}"><img class="imgPos" src="${yes_img}"></c:when>
														<c:otherwise><img class="imgPos" src="${no_img}"></c:otherwise>
													</c:choose>
												</span>
	                                        </td>
	                                        <td>
	                                            <span>
													<a title="<spring:message code="app.courseTemplate.action.placeholder.upload_zm" />" 
														onclick="setTemplate('${entity.batchId}','${entity.gradeNo}','${entity.courseNo}',1,1)">
														<spring:message code="app.courseTemplate.action.upload_zm" /></a>
													<a title="<spring:message code="app.courseTemplate.action.placeholder.edit_zm" />" target="_blank" 
														onclick="setTemplate('${record.batchId}','${entity.gradeNo}','${entity.courseNo}',1,2)">
														<spring:message code="app.courseTemplate.action.edit_zm" /></a>
													<br>
													<a title="<spring:message code="app.courseTemplate.action.placeholder.upload_fm" />" 
														onclick="setTemplate('${entity.batchId}','${entity.gradeNo}','${entity.courseNo}',2,1)">
														<spring:message code="app.courseTemplate.action.upload_fm" /></a>
													<a title="<spring:message code="app.courseTemplate.action.placeholder.edit_fm" />" target="_blank" 
														onclick="setTemplate('${entity.batchId}','${entity.gradeNo}','${entity.courseNo}',2,2)">
														<spring:message code="app.courseTemplate.action.edit_fm" /></a>
													<br>
													<a title="<spring:message code="app.courseTemplate.action.setKgtAns" />" 
														onclick="setTemplate('${entity.batchId}','${entity.gradeNo}','${entity.courseNo}',1,3)">
														<spring:message code="app.courseTemplate.action.setKgtAns" /></a>
												</span>
	                                        </td>
	                                    </tr>
	                                </c:forEach>
	                            </tbody>
	                        </table>
	                        <div class="row" id="splitPageDiv">
								<jsp:include page="/views/common/splitPage.jsp">
									<jsp:param value="mainPanel" name="divId"/>
									<jsp:param value="splitPage" name="formId"/>
									<jsp:param value="splitPageDiv" name="splitPageDiv"/>
								</jsp:include>
							</div>
						</form>
				    </div>
				</div>
			</div>
		</div>
    </body>
</html>
